/*
 * MMPPGenerator.h
 *
 *  Created on: 28-11-2013
 *      Author: Tomasz Lis
 */

#ifndef MMPPGENERATOR_H_
#define MMPPGENERATOR_H_


#include <omnetpp.h>
#include <packet_m.h>
#include <stdio.h>
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <algorithm>
#include <csimplemodule.h>

using namespace std;

class MMPPGenerator : public cSimpleModule {
public:
    int id;
    int lastPacketId;
    int lastSessionId;
    int destinationId;
    int classPriority;

    int nOStates;
    double** matrix;
    int currentState;
    vector<double> lambdas;

    cLongHistogram delaysMMPP;
    cOutVector delaysMMPPVector;

    simtime_t timeUnit;
    simtime_t lastPacketTime;
    MMPPGenerator();
    virtual ~MMPPGenerator();
    void initialize();
    virtual void finish();
    virtual void handleMessage(cMessage *message);
    void prepareStates();
    Packet*  generatePacket(int dst, int classPriority);
};

Define_Module(MMPPGenerator);
#endif /* MMPPGENERATOR_H_ */
